From ed59407a6d66473e123cfba0485ee1e5219c9c4f Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Thu, 25 Nov 2004 15:49:16 +0000 Subject: [PATCH] bitkeeper revision 1.1159.196.1 (41a5fefcFQhZEJPIqPpQEw0opKThFw) Remove MMU_UPDATE_DEBUG stuff. --- .../arch/xen/i386/mm/hypervisor.c | 76 ----------------- .../include/asm-xen/asm-i386/page.h | 9 -- .../include/asm-xen/hypervisor.h | 85 ------------------- 3 files changed, 170 deletions(-) diff --git a/linux-2.6.9-xen-sparse/arch/xen/i386/mm/hypervisor.c b/linux-2.6.9-xen-sparse/arch/xen/i386/mm/hypervisor.c index c6078aa5cd..d950b8a8e2 100644 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/mm/hypervisor.c +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/mm/hypervisor.c @@ -56,62 +56,6 @@ static mmu_update_t update_queue[QUEUE_SIZE]; unsigned int mmu_update_queue_idx = 0; #define idx mmu_update_queue_idx -#if MMU_UPDATE_DEBUG > 0 -page_update_debug_t update_debug_queue[QUEUE_SIZE] = {{0}}; -#undef queue_l1_entry_update -#undef queue_l2_entry_update -#endif -#if MMU_UPDATE_DEBUG > 3 -static void DEBUG_allow_pt_reads(void) -{ - pte_t *pte; - mmu_update_t update; - int i; - for ( i = idx-1; i >= 0; i-- ) - { - pte = update_debug_queue[i].ptep; - if ( pte == NULL ) continue; - update_debug_queue[i].ptep = NULL; - update.ptr = virt_to_machine(pte); - update.val = update_debug_queue[i].pteval; - HYPERVISOR_mmu_update(&update, 1, NULL); - } -} -static void DEBUG_disallow_pt_read(unsigned long va) -{ - pte_t *pte; - pmd_t *pmd; - pgd_t *pgd; - unsigned long pteval; - /* - * We may fault because of an already outstanding update. - * That's okay -- it'll get fixed up in the fault handler. - */ - mmu_update_t update; - pgd = pgd_offset_k(va); - pmd = pmd_offset(pgd, va); - pte = pte_offset_kernel(pmd, va); /* XXXcl */ - update.ptr = virt_to_machine(pte); - pteval = *(unsigned long *)pte; - update.val = pteval & ~_PAGE_PRESENT; - HYPERVISOR_mmu_update(&update, 1, NULL); - update_debug_queue[idx].ptep = pte; - update_debug_queue[idx].pteval = pteval; -} -#endif - -#if MMU_UPDATE_DEBUG > 1 -#undef queue_pt_switch -#undef queue_tlb_flush -#undef queue_invlpg -#undef queue_pgd_pin -#undef queue_pgd_unpin -#undef queue_pte_pin -#undef queue_pte_unpin -#undef queue_set_ldt -#endif - - /* * MULTICALL_flush_page_update_queue: * This is a version of the flush which queues as part of a multicall. @@ -123,13 +67,6 @@ void MULTICALL_flush_page_update_queue(void) spin_lock_irqsave(&update_lock, flags); if ( (_idx = idx) != 0 ) { -#if MMU_UPDATE_DEBUG > 1 - if (idx > 1) - printk("Flushing %d entries from pt update queue\n", idx); -#endif -#if MMU_UPDATE_DEBUG > 3 - DEBUG_allow_pt_reads(); -#endif idx = 0; wmb(); /* Make sure index is cleared first to avoid double updates. */ queue_multicall3(__HYPERVISOR_mmu_update, @@ -143,13 +80,6 @@ void MULTICALL_flush_page_update_queue(void) static inline void __flush_page_update_queue(void) { unsigned int _idx = idx; -#if MMU_UPDATE_DEBUG > 1 - if (idx > 1) - printk("Flushing %d entries from pt update queue\n", idx); -#endif -#if MMU_UPDATE_DEBUG > 3 - DEBUG_allow_pt_reads(); -#endif idx = 0; wmb(); /* Make sure index is cleared first to avoid double updates. */ if ( unlikely(HYPERVISOR_mmu_update(update_queue, _idx, NULL) < 0) ) @@ -183,9 +113,6 @@ void queue_l1_entry_update(pte_t *ptr, unsigned long val) { unsigned long flags; spin_lock_irqsave(&update_lock, flags); -#if MMU_UPDATE_DEBUG > 3 - DEBUG_disallow_pt_read((unsigned long)ptr); -#endif update_queue[idx].ptr = virt_to_machine(ptr); update_queue[idx].val = val; increment_index(); @@ -303,9 +230,6 @@ void xen_l1_entry_update(pte_t *ptr, unsigned long val) { unsigned long flags; spin_lock_irqsave(&update_lock, flags); -#if MMU_UPDATE_DEBUG > 3 - DEBUG_disallow_pt_read((unsigned long)ptr); -#endif update_queue[idx].ptr = virt_to_machine(ptr); update_queue[idx].val = val; increment_index_and_flush(); diff --git a/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h b/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h index dcea67475a..0c8c031705 100644 --- a/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h +++ b/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h @@ -90,16 +90,7 @@ typedef struct { unsigned long pmd; } pmd_t; typedef struct { unsigned long pgd; } pgd_t; typedef struct { unsigned long pgprot; } pgprot_t; #define boot_pte_t pte_t /* or would you rather have a typedef */ -#if 0 /* XXXcl for MMU_UPDATE_DEBUG */ -static inline unsigned long pte_val(pte_t x) -{ - unsigned long ret = x.pte_low; - if ( (ret & 1) ) ret = machine_to_phys(ret); - return ret; -} -#else #define pte_val(x) (((x).pte_low & 1) ? machine_to_phys((x).pte_low) : (x).pte_low) -#endif #define pte_val_ma(x) ((x).pte_low) #define HPAGE_SHIFT 22 #endif diff --git a/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h b/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h index caca29bd86..235c4fc5a6 100644 --- a/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h +++ b/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h @@ -94,91 +94,6 @@ void xen_pte_pin(unsigned long ptr); void xen_pte_unpin(unsigned long ptr); void xen_set_ldt(unsigned long ptr, unsigned long bytes); void xen_machphys_update(unsigned long mfn, unsigned long pfn); -#define MMU_UPDATE_DEBUG 0 - -#if MMU_UPDATE_DEBUG > 0 -typedef struct { - void *ptr; - unsigned long val, pteval; - void *ptep; - int line; char *file; -} page_update_debug_t; -extern page_update_debug_t update_debug_queue[]; -#define queue_l1_entry_update(_p,_v) ({ \ - update_debug_queue[mmu_update_queue_idx].ptr = (_p); \ - update_debug_queue[mmu_update_queue_idx].val = (_v); \ - update_debug_queue[mmu_update_queue_idx].line = __LINE__; \ - update_debug_queue[mmu_update_queue_idx].file = __FILE__; \ - queue_l1_entry_update((_p),(_v)); \ -}) -#define queue_l2_entry_update(_p,_v) ({ \ - update_debug_queue[mmu_update_queue_idx].ptr = (_p); \ - update_debug_queue[mmu_update_queue_idx].val = (_v); \ - update_debug_queue[mmu_update_queue_idx].line = __LINE__; \ - update_debug_queue[mmu_update_queue_idx].file = __FILE__; \ - queue_l2_entry_update((_p),(_v)); \ -}) -#endif - -#if MMU_UPDATE_DEBUG > 1 -#if MMU_UPDATE_DEBUG > 2 -#undef queue_l1_entry_update -#define queue_l1_entry_update(_p,_v) ({ \ - update_debug_queue[mmu_update_queue_idx].ptr = (_p); \ - update_debug_queue[mmu_update_queue_idx].val = (_v); \ - update_debug_queue[mmu_update_queue_idx].line = __LINE__; \ - update_debug_queue[mmu_update_queue_idx].file = __FILE__; \ - printk("L1 %s %d: %p/%08lx (%08lx -> %08lx)\n", __FILE__, __LINE__, \ - (_p), virt_to_machine(_p), pte_val(*(_p)), \ - (unsigned long)(_v)); \ - queue_l1_entry_update((_p),(_v)); \ -}) -#endif -#undef queue_l2_entry_update -#define queue_l2_entry_update(_p,_v) ({ \ - update_debug_queue[mmu_update_queue_idx].ptr = (_p); \ - update_debug_queue[mmu_update_queue_idx].val = (_v); \ - update_debug_queue[mmu_update_queue_idx].line = __LINE__; \ - update_debug_queue[mmu_update_queue_idx].file = __FILE__; \ - printk("L2 %s %d: %p/%08lx (%08lx -> %08lx)\n", __FILE__, __LINE__, \ - (_p), virt_to_machine(_p), pmd_val(*_p), \ - (unsigned long)(_v)); \ - queue_l2_entry_update((_p),(_v)); \ -}) -#define queue_pt_switch(_p) ({ \ - printk("PTSWITCH %s %d: %08lx\n", __FILE__, __LINE__, (_p)); \ - queue_pt_switch(_p); \ -}) -#define queue_tlb_flush() ({ \ - printk("TLB FLUSH %s %d\n", __FILE__, __LINE__); \ - queue_tlb_flush(); \ -}) -#define queue_invlpg(_p) ({ \ - printk("INVLPG %s %d: %08lx\n", __FILE__, __LINE__, (_p)); \ - queue_invlpg(_p); \ -}) -#define queue_pgd_pin(_p) ({ \ - printk("PGD PIN %s %d: %08lx/%08lx\n", __FILE__, __LINE__, (_p), \ - phys_to_machine(_p)); \ - queue_pgd_pin(_p); \ -}) -#define queue_pgd_unpin(_p) ({ \ - printk("PGD UNPIN %s %d: %08lx\n", __FILE__, __LINE__, (_p)); \ - queue_pgd_unpin(_p); \ -}) -#define queue_pte_pin(_p) ({ \ - printk("PTE PIN %s %d: %08lx\n", __FILE__, __LINE__, (_p)); \ - queue_pte_pin(_p); \ -}) -#define queue_pte_unpin(_p) ({ \ - printk("PTE UNPIN %s %d: %08lx\n", __FILE__, __LINE__, (_p)); \ - queue_pte_unpin(_p); \ -}) -#define queue_set_ldt(_p,_l) ({ \ - printk("SETL LDT %s %d: %08lx %d\n", __FILE__, __LINE__, (_p), (_l)); \ - queue_set_ldt((_p), (_l)); \ -}) -#endif void _flush_page_update_queue(void); static inline int flush_page_update_queue(void) -- 2.30.2